<?PHP use_javascript("/js/i18n/grid.locale-cn.js") ?>
<?PHP use_javascript("/js/jquery.jqGrid.min.js") ?>
<?PHP use_stylesheet("/css/ui.jqgrid.css") ?>
<?PHP include_partial("global/rightnow") ?>



<script type="text/javascript">
    $(document).ready(function(){

        $("#table_pno_list").jqGrid({
            url: "<?PHP echo url_for("pno/getPnoList.json") ?>",
            datatype: "json",
            width: 700,
            colNames:["Id","料号","名称","规格","详细规格","计量单位","最小定购量","最大定购量","固定定购量","来源别","ABC分类","安全存量","再订购点","经济订购量","订购政策","BOM","录入人员","状态","录入日期","最后维护日期"],
            //colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
            colModel:[
                {name: "id", hidden: true},
                {name: "pno_no"},
                {name: "pno_name"},
                {name: "pno_desc"},
                {name: "pno_fdesc", width: 80, hidden: true},
                {name: "pno_uq"},
                {name: "pno_minorq",hidden: true},
                {name: "pno_maxorq",hidden: true},
                {name: "pno_orq",hidden: true},
                {name: "pno_src",hidden: true},
                {name: "pno_abc"},
                {name: "pno_sfq",hidden: true},
                {name: "pno_rop",hidden: true},
                {name: "pno_eoq",hidden: true},
                {name: "pno_pp"},
                {name: "pno_bom",hidden: true},
                {name: "pno_opr", align:"center"},
                {name: "pno_status", align:"center"},
                {name: "created_at",hidden: true},
                {name: "updated_at",hidden: true},
            ],
            rowNum: 10,
            rowList: [10,20,30],
            pager: "#pager_pno_list",
            sortname: 'id',
            viewrecords: true,
            sortorder: "desc",
            caption: "&nbsp;"
            /*subGrid: true,
            subGridUrl: "<?PHP //echo url_for("pno/getPnoD.json") ?>",
            subGridModel: [{
                    name: ['摘要', '科目', '借方金额', '贷方金额'],
                    width: [80,150,60,60],
                    params: ['id']
            }]*/

        });
        $("#table_pno_list").jqGrid('navGrid','#pager_pno_list',{edit:false, add:false, del:false })
            .jqGrid('navButtonAdd',"#pager_pno_list",{
                caption:"显示/隐藏列",
                id:"show_hide_column",
                onClickButton: function() {
                    $('#table_pno_list').setColumns()
                }
        });


    });

</script>



<!--

<h1>Mfg pnos List</h1>

<table>
  <thead>
    <tr>
      <th>Id</th>
      <th>Acct set</th>
      <th>Pno no</th>
      <th>Pno name</th>
      <th>Pno desc</th>
      <th>Pno fdesc</th>
      <th>Pno uq</th>
      <th>Pno minorq</th>
      <th>Pno maxorq</th>
      <th>Pno orq</th>
      <th>Pno src</th>
      <th>Pno abc</th>
      <th>Pno sfq</th>
      <th>Pno rop</th>
      <th>Pno eoq</th>
      <th>Pno pp</th>
      <th>Pno bom</th>
      <th>Pno opr</th>
      <th>Created at</th>
      <th>Updated at</th>
    </tr>
  </thead>
  <tbody>
    <?php //foreach ($mfg_pnos as $mfg_pno): ?>
    <tr>
      <td><a href="<?php //echo url_for('pno/edit?id='.$mfg_pno->getId()) ?>"><?php //echo $mfg_pno->getId() ?></a></td>
      <td><?php //echo $mfg_pno->getAcctSetId() ?></td>
      <td><?php //echo $mfg_pno->getPnoNo() ?></td>
      <td><?php //echo $mfg_pno->getPnoName() ?></td>
      <td><?php //echo $mfg_pno->getPnoDesc() ?></td>
      <td><?php //echo $mfg_pno->getPnoFdesc() ?></td>
      <td><?php //echo $mfg_pno->getPnoUq() ?></td>
      <td><?php //echo $mfg_pno->getPnoMinorq() ?></td>
      <td><?php //echo $mfg_pno->getPnoMaxorq() ?></td>
      <td><?php //echo $mfg_pno->getPnoOrq() ?></td>
      <td><?php //echo $mfg_pno->getPnoSrc() ?></td>
      <td><?php //echo $mfg_pno->getPnoAbc() ?></td>
      <td><?php //echo $mfg_pno->getPnoSfq() ?></td>
      <td><?php //echo $mfg_pno->getPnoRop() ?></td>
      <td><?php //echo $mfg_pno->getPnoEoq() ?></td>
      <td><?php //echo $mfg_pno->getPnoPp() ?></td>
      <td><?php //echo $mfg_pno->getPnoBom() ?></td>
      <td><?php //echo $mfg_pno->getPnoOpr() ?></td>
      <td><?php //echo $mfg_pno->getCreatedAt() ?></td>
      <td><?php //echo $mfg_pno->getUpdatedAt() ?></td>
    </tr>
    <?php //endforeach; ?>
  </tbody>
</table>

  <a href="<?php //echo url_for('pno/new') ?>">New</a>
-->

<div id="box">
    <h3>料号浏览与查询</h3>
    <table id="table_pno_list" width="100%" align="center">
    </table>
    <div id="pager_pno_list"></div>
</div>
<br />

